package com.glory.cqaospda.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.glory.cqaospda.R;
import com.glory.cqaospda.bean.QueryProductionInfoBean;
import com.glory.cqaospda.bean.QueryRepairInfoBean;

import java.util.List;

import androidx.annotation.Nullable;

/**
 * @author lenovo
 */
public class ProductionInfoAdapter extends BaseQuickAdapter<QueryProductionInfoBean.ProductList, BaseViewHolder> {

    private List<QueryProductionInfoBean.ProductList> datalist;

    public ProductionInfoAdapter(@Nullable List<QueryProductionInfoBean.ProductList> data) {
        super(R.layout.adapter_repairinfo, data);
        datalist = data;
    }

    @Override
    protected void convert(BaseViewHolder helper, QueryProductionInfoBean.ProductList item) {
        helper.setVisible(R.id.tvLotID,true);
        helper.setVisible(R.id.tvPriority,true);
        helper.setText(R.id.tvOrderName,item.getMLotNo().equals("")?"尾批":"主批");
        helper.setText(R.id.tvPriority, item.getMCustomer());
        helper.setText(R.id.tvLotID, item.getMLotNo().equals("")?item.getMLotNo():item.getMRLotNo());
        helper.setText(R.id.tvRepairReason, item.getMPackageType());
        helper.setText(R.id.tvState, item.getMProductType());
        helper.setText(R.id.tvLotQty, item.getMInputNumbe());
    }

}
